package com.houger.ddd.seckill.constant;

import java.util.Arrays;

public enum InvLimitTypeEnum {

    NO_LIMIT( 0, "无限制"),
    LIMIT( 1, "有限制"),
    ;
    private int value;
    private String desc;

    InvLimitTypeEnum(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public int getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    public static InvLimitTypeEnum getEnumByValue(int value) {
        return Arrays.stream(InvLimitTypeEnum.values()).filter(a -> a.value == value).findFirst().orElse(null);
    }

}
